1. Field of the Invention
The present invention relates to an adapter for a memory device used in a host computer and particularly to a PC card adapter arranged for detachably connecting a memory device smaller in size than the PC card to the PC card ATA interface of a host computer.
2. Description of the Related Art
A variety of portable apparatuses have rapidly prevailed throughout the market. Those portable apparatuses are commonly accompanied with a detachable external memory device for exchanging data with other apparatuses. A representative external memory device is a PC card. The PC cards are generally installed in personal computers, digital cameras, personal digital assistants (PDA), and hand-held terminals. Digital cameras commonly accompany small memory devices such as smart media cards, which can not conform to the ATA interface, for storage of image data. A PC card adapter is used for connecting the PC card to the ATA interface and allowing a personal computer to read and write image data on the memory device. Such a PC card adapter is illustrated below as a typical adapter for a memory device.
The PC card ATA interface is commonly used as the interface to a PC card. The ATA interface has two modes used for accessing the memory area: a logical block access (LBA) mode for allocating sector numbers to the memory area from the top to be accessed; and a cylinder head sector (CHS) mode for reading and writing data by pointing to the location determined by a cylinder, a head, and a sector. It is also essential for the reading and writing of data in the CHS mode to specify the number of heads (the maximum of the applicable head number plus one) and the number of sectors per track (the maximum of the sector number to be specified).
A conventional PC card adapter is pre-arranged to accommodate such a size of memory capacity that the number of heads specified by the PC card adapter is equal to the number of heads needed for reading and writing data on the memory area of a memory device in the CHS mode. Simultaneously, the numbers of sectors per track specified by the PC card adapter is equal to the number of sectors per track needed for reading and writing data in the CHS mode. This allows a host computer to selectively use either the number of heads and the number of sectors per track specified by the PC card adapter or those in the memory area of the memory device. In each case, the number of heads and the number of sectors per track are equal to the others, hence allowing the host computer to read and write data in the memory device in the CHS mode.
For pre-arranging to match the number of heads and the number of sectors per track, the number of heads and the number of sectors per track depending on the memory capacity are stored in the form of a table in a ROM.
However, if not pre-arranged to match the number of heads and the number of sectors per track with the memory device, the number of heads and the number of sectors per track specified by the conventional PC card adapter may be different from those stored in the memory area of the memory device. If different, a known adapter for a memory device such as the conventional PC card adapter is prevented from normally accessing the memory device in the CHS mode.
When loaded with a newly introduced memory device which is unique in the number of heads and the number of sectors per track, the conventional adapter for a memory device is not compatible and it is difficult to access the memory device in the CHS mode.
The number of combinations of the number of heads and-the number of sectors per track stored in the form of a table in the ROM is dependent on the memory capacity. When being compatible to various types of memories, an adapter needs a large table, thus requiring a large capacity ROM.
This invention provides an adapter for a memory device which can access the memory device in the CHS mode when being incompatible in the number of heads and the number of sectors with the memory device and a connecting method using the same.
The adapter for a memory device according to the present invention arranged for connecting the memory device having a memory area the ATA interface of a host computer comprises:
(a) a first connector for connecting to the memory device;
(b) a second connector for connecting to the ATA interface of the host computer;
(c) a memory device accessing means for reading and writing data on the memory area of the memory device;
(d) an ATA interface controller for exchanging data with the host computer through the ATA interface of the host computer; and
(e) a file format identifying means for identifying the file format of data stored in the memory area of the memory device, the file format identifying means comprising (e-1) a means for identifying the type of the file format from a file format data stored in the memory device and (e-2) a means for retrieving and saving the number of heads and the number of sectors per track.
The number of heads and the number of sectors per track specified by the adapter for a memory device can accordingly be equal to those in the memory area of the memory device. The problem with a conventional adapter being that the action of accessing is hardly executed in the CHS mode can be solved with the adapter of the present invention. The adapter of the present invention can access, in the CHS mode, the memory device with a newly-provided number of heads and a newly-provided number of sectors per track.
Another adapter for a memory device according to the present invention comprises:
(a) a first connector for connecting the adaptor to the memory device;
(b) a second connector for connecting the adaptor to the ATA interface of the host computer;
(c) a memory device accessing means for reading and writing data on the memory area of the memory device;
(d) an ATA interface controller for exchanging data with the host computer through the ATA interface of the host computer; and
(e) a file format detecting means for examining whether or not the data stored in the memory area of the memory device includes a file format data, the file format detecting means comprising (e-1) a means for calculating and holding the number of heads and the number of sectors per track when it is possible to retrieve both the number of heads and the number of sectors per track from the data stored in the memory area of the memory device. Consequently, even if the memory area of the memory device fails to accommodate the number of heads and the number of sectors per track in the adapter, it can successfully be accessed in the CHS mode. Also, it is unnecessary to hold the data about the number of heads and the number of sectors per track in the form of a table in the ROM depending on the memory capacity and the size of the ROM can thus be minimized.
The present invention is equally applicable to a PC card adapter which conforms to the PC card ATA interface standard.